package cn.swing.main.srv.cv.utils;

public class ManhattanDistance {

    public static double calculateManhattanDistance(double x1, double y1, double x2, double y2) {
        return Math.abs(x2 - x1) + Math.abs(y2 - y1);
    }

    public static void main(String[] args) {
        int x1 = 12, y1 = 10;
        int x2 = 11, y2 = 12;

        double distance = calculateManhattanDistance(x1, y1, x2, y2);
        System.out.println("Manhattan Distance: " + distance);
    }

}

